package org.chen.web.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.chen.model.domain.Users;
import org.chen.model.response.ApiResult;
import org.chen.model.response.ApiResultUtil;
import org.chen.model.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: 陈亮
 * @Date: 2019/3/24 22:55
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UsersService usersService;

    @RequiresPermissions("sys:good:list")
    @GetMapping("findList")
    public ApiResult<Users> findList() {
        List<Users> list = usersService.findAll();
        return ApiResultUtil.success(list);
    }
}
